<template>
  <div class="section">
    <div v-if="props.mode === 'update'" class="grid grid-cols-3 gap-3">
      <div class="col-span-1 btn-default text-red-5" @click="props.remove">删除</div>
      <div class="col-span-2 btn-primary" @click="props.submit">保存</div>
    </div>
    <div v-else class="btn-primary" @click="submit">创建</div>
  </div>
</template>

<script setup lang='ts'>

interface IProps {
  mode: 'create' | 'update',
  submit?: () => void,
  remove?: () => void,
}

const props = withDefaults(defineProps<IProps>(), {
  opMode: 'create',
  submit: () => { },
  remove: () => { },
})

</script>

<style></style>